-
Notifications
You must be signed in to change notification settings - Fork 0
ERA-11397 & ERA-11399 #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERA-11397 & ERA-11399 #1290
Conversation
…shown in collections
@@ -31,10 +28,6 @@ const ContainedReportListItem = ({ cardsExpanded, onCollapse, onExpand, report } | |||
const { t } = useTranslation('details-view', { keyPrefix: 'containedReportListItem' }); | |||
|
|||
const reportFromEventStore = useSelector((state) => state.data.eventStore[report.id]); | |||
const eventSchema = useSelector((state) => reportFromEventStore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of all the logic removed here was only to render the form summary, so it didn't make sense to keep it here. I moved it to the ReportFormSummary
component keeping the parent (this component) cleaner.
@@ -0,0 +1,56 @@ | |||
import React, { useMemo } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to divide (and conquer) the ReportFormSummary
component into 3 parts:
- The event details that are not part of the schema (reported by, priority, location, date...) those are rendered by the parent component.
- The form summary for v1 schemas are rendered here.
- And the form summary for v2 schemas also have their own file now 👍
@@ -1,42 +1 @@ | |||
export const CHOICE_LIST_ELEMENT_CHOICE_TYPES = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several utilities that used to be only used by the SchemaForm
are now used by the ReportFormSummary
so it made sense to extract them to a more general utils
folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🥳
What does this PR do?
How does it look
Saved event with a complex v2 schema showing the form summary inside a collection:

Relevant link(s)
Any background context you want to provide(if applicable)
After Ernesto's fix to support storing events with our new schema format, events were saved successfully without having to do further changes to the saving flow. However, when fetching stored events that belong in a collection, the event form summary wasn't rendering properly because we never added support to v2 schemas there. All changes in this PR are related to that.